package org.openems;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

import org.openems.model.TraceModel;
import org.slim3.datastore.Datastore;

@Path("/analysis") 
public class AnalysisResouce {

	@GET
	@Produces("text/plain")
	public String get() {
	    return "Analysis";
	}
	
	@POST
	@Consumes("application/xml")
	@Produces("application/xml")
	public ResultEntity post(PrimitiveTraceEntity trace) {
	    TraceModel traceModel = new TraceModel();
	    traceModel.setValue(trace.y);
		Datastore.put(traceModel);
		return new ResultEntity(trace);
	}
}
